<!-- 需求描述 -->
<template>
  <view class="bgf mt-15">
    <view class="linh-44 px-15 fz-16 fw-7 borderBottom">需求描述</view>
    <view class="pa-15 fz-14 inputBox" v-if="isTextarea">
      <FormInput
        type="textarea"
        :styles="inputStyles"
        placeholder="请输入您想要联络的事由"
        :model-value="modelValue"
        :maxlength="200"
        @update:model-value="($event) => emit('update:modelValue', $event)"
      />
    </view>
    <view class="pa-15 fz-14" v-else>
      <text>{{ modelValue || '暂无描述' }}</text>
    </view>
  </view>
</template>

<script lang="ts" setup>
  import FormInput from '@/components/Form/components/FormInput.vue';
  import { propTypes } from '@/utils/propTypes';

  defineProps({
    modelValue: propTypes.string.def(''),
    isTextarea: propTypes.bool.def(true),
  });

  const emit = defineEmits(['update:modelValue']);

  const inputStyles = {
    backgroundColor: '#F5F5F5',
    borderColor: '#F5F5F5',
  };
</script>
<style lang="scss" scoped></style>
